import os;

print('this is os demo!');
nums = range(0,100);
strs = ''
file = open('demo.txt',mode="r+");
for num in nums:
	print(num);
	strs+=str(num)
file.write(strs);
file.close();
print('文件写入成功')